cmake_minimum_required(VERSION 3.19)
project(LearningCPlusOpenCV)

set(CMAKE_CXX_STANDARD 14)

#修改成自己的编译目录lib
set(OpenCV_DIR K:/opencv4.6/opencv_mingw_build/install/x64/mingw/lib)
FIND_PACKAGE(OpenCV REQUIRED) #找到opencv的安装路径
include_directories(cmake-build-debug ${OpenCV_INCLUDE_DIRS}) #加载opencv的头文件
link_directories(${OpenCV_LIBS})

add_executable(main_cmake main.cpp opencv/OpenCv.h
        opencv/1_base.cpp
        opencv/2_read_imshow_write.cpp
        opencv/3_base_operate.cpp
        opencv/4_image_ZFpicture.cpp
        opencv/5_Image_filter.cpp
        opencv/6_image_shapedeal.cpp
        cpp/1_struct_pointer_linklist.cpp
        cpp/cpp.h cpp/2_template.cpp
        cpp/3_stl_container.cpp
        opencv/10_stereoscopic_vision.cpp
        opencv/7_target_detect.cpp
        opencv/12_machine_depth_learning.cpp)
TARGET_LINK_LIBRARIES(main_cmake ${OpenCV_LIBS})   #链接lib文件道可执行文件中


